package com.zzq.calcgame.entity;

/**
 * 操作符号
 */
public enum  Operator {

    ADD(0,"加"),MINUS(1,"减"),TIMES(2,"乘"),DIVISION(3,"除");
    int type;
    String description,name;

    public static String NAME[]={"加","减","乘","除"};

    Operator(int type, String description) {
        this.type = type;
        this.description = description;
    }

    public static Operator getOperator(int type){
        Operator op=Operator.ADD;
        switch (type){
            case 0:
                op=Operator.ADD;
                op.setName("+");
                break;
            case 1:
                op=Operator.MINUS;
                op.setName("-");
                break;
            case 2:
                op=Operator.TIMES;
                op.setName("*");
                break;
            case 31:
                op=Operator.DIVISION;
                op.setName("/");
                break;
        }
        return op;
    }
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
